home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / Components.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  26.1 KB  |  896 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Components.a
  3. ;
  4. ;    Contains:    Component Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1991-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  19. __COMPONENTS__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  25.     include 'MacTypes.a'
  26.     ENDIF
  27.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  28.     include 'MixedMode.a'
  29.     ENDIF
  30.  
  31.  
  32. kAppleManufacturer                EQU        'appl'                ; Apple supplied components 
  33. kComponentResourceType            EQU        'thng'                ; a components resource type 
  34. kComponentAliasResourceType        EQU        'thga'                ; component alias resource type 
  35.  
  36. kAnyComponentType                EQU        0
  37. kAnyComponentSubType            EQU        0
  38. kAnyComponentManufacturer        EQU        0
  39. kAnyComponentFlagsMask            EQU        0
  40.  
  41. cmpWantsRegisterMessage            EQU        $80000000
  42.  
  43. kComponentOpenSelect            EQU        -1                    ; ComponentInstance for this open 
  44. kComponentCloseSelect            EQU        -2                    ; ComponentInstance for this close 
  45. kComponentCanDoSelect            EQU        -3                    ; selector # being queried 
  46. kComponentVersionSelect            EQU        -4                    ; no params 
  47. kComponentRegisterSelect        EQU        -5                    ; no params 
  48. kComponentTargetSelect            EQU        -6                    ; ComponentInstance for top of call chain 
  49. kComponentUnregisterSelect        EQU        -7                    ; no params 
  50. kComponentGetMPWorkFunctionSelect EQU    -8                    ; some params 
  51. ;  Component Resource Extension flags 
  52.  
  53. componentDoAutoVersion            EQU        $01
  54. componentWantsUnregister        EQU        $02
  55. componentAutoVersionIncludeFlags EQU    $04
  56. componentHasMultiplePlatforms    EQU        $08
  57. componentLoadResident            EQU        $10
  58.  
  59.  
  60. ;  Set Default Component flags 
  61.  
  62. defaultComponentIdentical        EQU        0
  63. defaultComponentAnyFlags        EQU        1
  64. defaultComponentAnyManufacturer    EQU        2
  65. defaultComponentAnySubType        EQU        4
  66. defaultComponentAnyFlagsAnyManufacturer EQU 3
  67. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU 7
  68. ;  RegisterComponentResource flags 
  69.  
  70. registerComponentGlobal            EQU        1
  71. registerComponentNoDuplicates    EQU        2
  72. registerComponentAfterExisting    EQU        4
  73. registerComponentAliasesOnly    EQU        8
  74.  
  75. ComponentDescription    RECORD 0
  76. componentType             ds.l    1                ; offset: $0 (0)        ;  A unique 4-byte code indentifying the command set 
  77. componentSubType         ds.l    1                ; offset: $4 (4)        ;  Particular flavor of this instance 
  78. componentManufacturer     ds.l    1                ; offset: $8 (8)        ;  Vendor indentification 
  79. componentFlags             ds.l    1                ; offset: $C (12)        ;  8 each for Component,Type,SubType,Manuf/revision 
  80. componentFlagsMask         ds.l    1                ; offset: $10 (16)        ;  Mask for specifying which flags to consider in search, zero during registration 
  81. sizeof                     EQU *                    ; size:   $14 (20)
  82.                         ENDR
  83.  
  84. ResourceSpec            RECORD 0
  85. resType                     ds.l    1                ; offset: $0 (0)        ;  4-byte code  
  86. resID                     ds.w    1                ; offset: $4 (4)        ;               
  87. sizeof                     EQU *                    ; size:   $6 (6)
  88.                         ENDR
  89. ComponentResource        RECORD 0
  90. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  Registration parameters 
  91. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  92. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  93. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  94. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  95. sizeof                     EQU *                    ; size:   $2C (44)
  96.                         ENDR
  97. ; typedef struct ComponentResource *    ComponentResourcePtr
  98.  
  99. ; typedef ComponentResourcePtr *        ComponentResourceHandle
  100.  
  101. ComponentPlatformInfo    RECORD 0
  102. componentFlags             ds.l    1                ; offset: $0 (0)        ;  flags of Component 
  103. component                 ds        ResourceSpec    ; offset: $4 (4)        ;  resource where Component code is found 
  104. platformType             ds.w    1                ; offset: $A (10)        ;  gestaltSysArchitecture result 
  105. sizeof                     EQU *                    ; size:   $C (12)
  106.                         ENDR
  107. ComponentResourceExtension RECORD 0
  108. componentVersion         ds.l    1                ; offset: $0 (0)        ;  version of Component 
  109. componentRegisterFlags     ds.l    1                ; offset: $4 (4)        ;  flags for registration 
  110. componentIconFamily         ds.w    1                ; offset: $8 (8)        ;  resource id of Icon Family 
  111. sizeof                     EQU *                    ; size:   $A (10)
  112.                         ENDR
  113. ComponentPlatformInfoArray RECORD 0
  114. count                     ds.l    1                ; offset: $0 (0)
  115. platformArray             ds        ComponentPlatformInfo ; offset: $4 (4) <-- really an array of length one
  116. sizeof                     EQU *                    ; size:   $10 (16)
  117.                         ENDR
  118. ExtComponentResource    RECORD 0
  119. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  registration parameters 
  120. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  121. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  122. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  123. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  124. componentVersion         ds.l    1                ; offset: $2C (44)        ;  version of Component 
  125. componentRegisterFlags     ds.l    1                ; offset: $30 (48)        ;  flags for registration 
  126. componentIconFamily         ds.w    1                ; offset: $34 (52)        ;  resource id of Icon Family 
  127. count                     ds.l    1                ; offset: $36 (54)        ;  elements in platformArray 
  128. platformArray             ds        ComponentPlatformInfo ; offset: $3A (58) <-- really an array of length one
  129. sizeof                     EQU *                    ; size:   $46 (70)
  130.                         ENDR
  131. ComponentAliasResource    RECORD 0
  132. cr                         ds        ComponentResource ; offset: $0 (0)        ;  Registration parameters 
  133. aliasCD                     ds        ComponentDescription ; offset: $2C (44) ;  component alias description 
  134. sizeof                     EQU *                    ; size:   $40 (64)
  135.                         ENDR
  136. ;   Structure received by Component:        
  137. ComponentParameters        RECORD 0
  138. flags                     ds.b    1                ; offset: $0 (0)        ;  call modifiers: sync/async, deferred, immed, etc 
  139. paramSize                 ds.b    1                ; offset: $1 (1)        ;  size in bytes of actual parameters passed to this call 
  140. what                     ds.w    1                ; offset: $2 (2)        ;  routine selector, negative for Component management calls 
  141. params                     ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  actual parameters for the indicated routine 
  142. sizeof                     EQU *                    ; size:   $8 (8)
  143.                         ENDR
  144. ComponentRecord            RECORD 0
  145. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  146. sizeof                     EQU *                    ; size:   $4 (4)
  147.                         ENDR
  148. ; typedef struct ComponentRecord *        Component
  149.  
  150. ComponentInstanceRecord    RECORD 0
  151. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  152. sizeof                     EQU *                    ; size:   $4 (4)
  153.                         ENDR
  154. ; typedef struct ComponentInstanceRecord * ComponentInstance
  155.  
  156. RegisteredComponentRecord RECORD 0
  157. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  158. sizeof                     EQU *                    ; size:   $4 (4)
  159.                         ENDR
  160. RegisteredComponentInstanceRecord RECORD 0
  161. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  162. sizeof                     EQU *                    ; size:   $4 (4)
  163.                         ENDR
  164. ; typedef struct RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr
  165.  
  166. ; typedef long                             ComponentResult
  167.  
  168.  
  169. platform68k                        EQU        1                    ; platform type (response from gestaltSysArchitecture) 
  170. platformPowerPC                    EQU        2
  171. platformInterpreted                EQU        3
  172. platformWin32                    EQU        4
  173.  
  174. mpWorkFlagDoWork                EQU        $01
  175. mpWorkFlagDoCompletion            EQU        $02
  176. mpWorkFlagCopyWorkBlock            EQU        $04
  177. mpWorkFlagDontBlock                EQU        $08
  178. mpWorkFlagGetProcessorCount        EQU        $10
  179. mpWorkFlagGetIsRunning            EQU        $40
  180. ComponentMPWorkFunctionHeaderRecord RECORD 0
  181. headerSize                 ds.l    1                ; offset: $0 (0)
  182. recordSize                 ds.l    1                ; offset: $4 (4)
  183. workFlags                 ds.l    1                ; offset: $8 (8)
  184. processorCount             ds.w    1                ; offset: $C (12)
  185. unused                     ds.b    1                ; offset: $E (14)
  186. isRunning                 ds.b    1                ; offset: $F (15)
  187. sizeof                     EQU *                    ; size:   $10 (16)
  188.                         ENDR
  189. ; typedef struct ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr
  190.  
  191. ;    The parameter list for each ComponentFunction is unique. It is
  192. ;    therefore up to users to create the appropriate procInfo for their
  193. ;    own ComponentFunctions where necessary.
  194. ;
  195.  
  196. ; typedef UniversalProcPtr                 ComponentFunctionUPP
  197.  
  198.  
  199. ; ********************************************************
  200. ;*                                                        *
  201. ;*                  APPLICATION LEVEL CALLS                    *
  202. ;*                                                        *
  203. ;*******************************************************
  204.  
  205. ; ********************************************************
  206. ;* Component Database Add, Delete, and Query Routines
  207. ;*******************************************************
  208.  
  209. ;
  210. ; pascal Component RegisterComponent(ComponentDescription *cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
  211. ;
  212.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  213.         Macro
  214.         _RegisterComponent
  215.             moveq               #1,D0
  216.             dc.w                $A82A
  217.         EndM
  218.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  219.         IMPORT_CFM_FUNCTION RegisterComponent
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal Component RegisterComponentResource(ComponentResourceHandle cr, short global)
  224. ;
  225.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  226.         Macro
  227.         _RegisterComponentResource
  228.             moveq               #18,D0
  229.             dc.w                $A82A
  230.         EndM
  231.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  232.         IMPORT_CFM_FUNCTION RegisterComponentResource
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal OSErr UnregisterComponent(Component aComponent)
  237. ;
  238.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  239.         Macro
  240.         _UnregisterComponent
  241.             moveq               #2,D0
  242.             dc.w                $A82A
  243.         EndM
  244.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  245.         IMPORT_CFM_FUNCTION UnregisterComponent
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
  250. ;
  251.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  252.         Macro
  253.         _FindNextComponent
  254.             moveq               #4,D0
  255.             dc.w                $A82A
  256.         EndM
  257.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  258.         IMPORT_CFM_FUNCTION FindNextComponent
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal long CountComponents(ComponentDescription *looking)
  263. ;
  264.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  265.         Macro
  266.         _CountComponents
  267.             moveq               #3,D0
  268.             dc.w                $A82A
  269.         EndM
  270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION CountComponents
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *cd, Handle componentName, Handle componentInfo, Handle componentIcon)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         Macro
  279.         _GetComponentInfo
  280.             moveq               #5,D0
  281.             dc.w                $A82A
  282.         EndM
  283.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  284.         IMPORT_CFM_FUNCTION GetComponentInfo
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal long GetComponentListModSeed(void )
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         Macro
  292.         _GetComponentListModSeed
  293.             moveq               #6,D0
  294.             dc.w                $A82A
  295.         EndM
  296.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION GetComponentListModSeed
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal long GetComponentTypeModSeed(OSType componentType)
  302. ;
  303.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  304.         Macro
  305.         _GetComponentTypeModSeed
  306.             moveq               #44,D0
  307.             dc.w                $A82A
  308.         EndM
  309.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION GetComponentTypeModSeed
  311.     ENDIF
  312.  
  313. ; ********************************************************
  314. ;* Component Instance Allocation and dispatch routines
  315. ;*******************************************************
  316.  
  317. ;
  318. ; pascal OSErr OpenAComponent(Component aComponent, ComponentInstance *ci)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  321.         Macro
  322.         _OpenAComponent
  323.             moveq               #45,D0
  324.             dc.w                $A82A
  325.         EndM
  326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  327.         IMPORT_CFM_FUNCTION OpenAComponent
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal ComponentInstance OpenComponent(Component aComponent)
  332. ;
  333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  334.         Macro
  335.         _OpenComponent
  336.             moveq               #7,D0
  337.             dc.w                $A82A
  338.         EndM
  339.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  340.         IMPORT_CFM_FUNCTION OpenComponent
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
  345. ;
  346.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  347.         Macro
  348.         _CloseComponent
  349.             moveq               #8,D0
  350.             dc.w                $A82A
  351.         EndM
  352.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  353.         IMPORT_CFM_FUNCTION CloseComponent
  354.     ENDIF
  355.  
  356. ;
  357. ; pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
  358. ;
  359.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  360.         Macro
  361.         _GetComponentInstanceError
  362.             moveq               #10,D0
  363.             dc.w                $A82A
  364.         EndM
  365.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION GetComponentInstanceError
  367.     ENDIF
  368.  
  369. ; ********************************************************
  370. ;*                                                        *
  371. ;*                      CALLS MADE BY COMPONENTS              *
  372. ;*                                                        *
  373. ;*******************************************************
  374.  
  375. ; ********************************************************
  376. ;* Component Management routines
  377. ;*******************************************************
  378.  
  379. ;
  380. ; pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
  381. ;
  382.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  383.         Macro
  384.         _SetComponentInstanceError
  385.             moveq               #11,D0
  386.             dc.w                $A82A
  387.         EndM
  388.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  389.         IMPORT_CFM_FUNCTION SetComponentInstanceError
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal long GetComponentRefcon(Component aComponent)
  394. ;
  395.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  396.         Macro
  397.         _GetComponentRefcon
  398.             moveq               #16,D0
  399.             dc.w                $A82A
  400.         EndM
  401.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION GetComponentRefcon
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal void SetComponentRefcon(Component aComponent, long theRefcon)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         Macro
  410.         _SetComponentRefcon
  411.             moveq               #17,D0
  412.             dc.w                $A82A
  413.         EndM
  414.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  415.         IMPORT_CFM_FUNCTION SetComponentRefcon
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal short OpenComponentResFile(Component aComponent)
  420. ;
  421.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  422.         Macro
  423.         _OpenComponentResFile
  424.             moveq               #21,D0
  425.             dc.w                $A82A
  426.         EndM
  427.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  428.         IMPORT_CFM_FUNCTION OpenComponentResFile
  429.     ENDIF
  430.  
  431. ;
  432. ; pascal OSErr OpenAComponentResFile(Component aComponent, short *resRef)
  433. ;
  434.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  435.         Macro
  436.         _OpenAComponentResFile
  437.             moveq               #47,D0
  438.             dc.w                $A82A
  439.         EndM
  440.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  441.         IMPORT_CFM_FUNCTION OpenAComponentResFile
  442.     ENDIF
  443.  
  444. ;
  445. ; pascal OSErr CloseComponentResFile(short refnum)
  446. ;
  447.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  448.         Macro
  449.         _CloseComponentResFile
  450.             moveq               #24,D0
  451.             dc.w                $A82A
  452.         EndM
  453.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  454.         IMPORT_CFM_FUNCTION CloseComponentResFile
  455.     ENDIF
  456.  
  457. ;
  458. ; pascal OSErr GetComponentResource(Component aComponent, OSType resType, short resID, Handle *theResource)
  459. ;
  460.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  461.         Macro
  462.         _GetComponentResource
  463.             moveq               #53,D0
  464.             dc.w                $A82A
  465.         EndM
  466.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  467.         IMPORT_CFM_FUNCTION GetComponentResource
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal OSErr GetComponentIndString(Component aComponent, Str255 theString, short strListID, short index)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  474.         Macro
  475.         _GetComponentIndString
  476.             moveq               #54,D0
  477.             dc.w                $A82A
  478.         EndM
  479.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  480.         IMPORT_CFM_FUNCTION GetComponentIndString
  481.     ENDIF
  482.  
  483. ;
  484. ; pascal Component ResolveComponentAlias(Component aComponent)
  485. ;
  486.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  487.         Macro
  488.         _ResolveComponentAlias
  489.             moveq               #32,D0
  490.             dc.w                $A82A
  491.         EndM
  492.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  493.         IMPORT_CFM_FUNCTION ResolveComponentAlias
  494.     ENDIF
  495.  
  496. ; ********************************************************
  497. ;* Component Instance Management routines
  498. ;*******************************************************
  499.  
  500. ;
  501. ; pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
  502. ;
  503.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  504.         Macro
  505.         _GetComponentInstanceStorage
  506.             moveq               #12,D0
  507.             dc.w                $A82A
  508.         EndM
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION GetComponentInstanceStorage
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         Macro
  518.         _SetComponentInstanceStorage
  519.             moveq               #13,D0
  520.             dc.w                $A82A
  521.         EndM
  522.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  523.         IMPORT_CFM_FUNCTION SetComponentInstanceStorage
  524.     ENDIF
  525.  
  526. ;
  527. ; pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  530.         Macro
  531.         _GetComponentInstanceA5
  532.             moveq               #14,D0
  533.             dc.w                $A82A
  534.         EndM
  535.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  536.         IMPORT_CFM_FUNCTION GetComponentInstanceA5
  537.     ENDIF
  538.  
  539. ;
  540. ; pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
  541. ;
  542.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  543.         Macro
  544.         _SetComponentInstanceA5
  545.             moveq               #15,D0
  546.             dc.w                $A82A
  547.         EndM
  548.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  549.         IMPORT_CFM_FUNCTION SetComponentInstanceA5
  550.     ENDIF
  551.  
  552. ;
  553. ; pascal long CountComponentInstances(Component aComponent)
  554. ;
  555.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  556.         Macro
  557.         _CountComponentInstances
  558.             moveq               #19,D0
  559.             dc.w                $A82A
  560.         EndM
  561.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  562.         IMPORT_CFM_FUNCTION CountComponentInstances
  563.     ENDIF
  564.  
  565. ;  useful helper routines for convenient method dispatching 
  566. ;
  567. ; pascal long CallComponentFunction(ComponentParameters *params, ComponentFunctionUPP func)
  568. ;
  569.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  570.         Macro
  571.         _CallComponentFunction
  572.             moveq               #-1,D0
  573.             dc.w                $A82A
  574.         EndM
  575.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  576.         IMPORT_CFM_FUNCTION CallComponentFunction
  577.     ENDIF
  578.  
  579. ;
  580. ; pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunctionUPP func)
  581. ;
  582.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  583.         Macro
  584.         _CallComponentFunctionWithStorage
  585.             moveq               #-1,D0
  586.             dc.w                $A82A
  587.         EndM
  588.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  589.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorage
  590.     ENDIF
  591.  
  592.     IF TARGET_CPU_PPC ** TARGET_OS_MAC THEN
  593. ;
  594. ; pascal long CallComponentFunctionWithStorageProcInfo(Handle storage, ComponentParameters *params, ProcPtr func, long funcProcInfo)
  595. ;
  596.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  597.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorageProcInfo
  598.     ENDIF
  599.  
  600.     ELSE
  601.     ENDIF
  602. ;
  603. ; pascal long DelegateComponentCall(ComponentParameters *originalParams, ComponentInstance ci)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  606.         Macro
  607.         _DelegateComponentCall
  608.             moveq               #36,D0
  609.             dc.w                $A82A
  610.         EndM
  611.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION DelegateComponentCall
  613.     ENDIF
  614.  
  615. ;
  616. ; pascal OSErr SetDefaultComponent(Component aComponent, short flags)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  619.         Macro
  620.         _SetDefaultComponent
  621.             moveq               #30,D0
  622.             dc.w                $A82A
  623.         EndM
  624.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  625.         IMPORT_CFM_FUNCTION SetDefaultComponent
  626.     ENDIF
  627.  
  628. ;
  629. ; pascal ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType)
  630. ;
  631.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  632.         Macro
  633.         _OpenDefaultComponent
  634.             moveq               #33,D0
  635.             dc.w                $A82A
  636.         EndM
  637.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  638.         IMPORT_CFM_FUNCTION OpenDefaultComponent
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal OSErr OpenADefaultComponent(OSType componentType, OSType componentSubType, ComponentInstance *ci)
  643. ;
  644.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  645.         Macro
  646.         _OpenADefaultComponent
  647.             moveq               #46,D0
  648.             dc.w                $A82A
  649.         EndM
  650.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  651.         IMPORT_CFM_FUNCTION OpenADefaultComponent
  652.     ENDIF
  653.  
  654. ;
  655. ; pascal Component CaptureComponent(Component capturedComponent, Component capturingComponent)
  656. ;
  657.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  658.         Macro
  659.         _CaptureComponent
  660.             moveq               #28,D0
  661.             dc.w                $A82A
  662.         EndM
  663.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION CaptureComponent
  665.     ENDIF
  666.  
  667. ;
  668. ; pascal OSErr UncaptureComponent(Component aComponent)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  671.         Macro
  672.         _UncaptureComponent
  673.             moveq               #29,D0
  674.             dc.w                $A82A
  675.         EndM
  676.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  677.         IMPORT_CFM_FUNCTION UncaptureComponent
  678.     ENDIF
  679.  
  680. ;
  681. ; pascal long RegisterComponentResourceFile(short resRefNum, short global)
  682. ;
  683.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  684.         Macro
  685.         _RegisterComponentResourceFile
  686.             moveq               #20,D0
  687.             dc.w                $A82A
  688.         EndM
  689.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  690.         IMPORT_CFM_FUNCTION RegisterComponentResourceFile
  691.     ENDIF
  692.  
  693. ;
  694. ; pascal OSErr GetComponentIconSuite(Component aComponent, Handle *iconSuite)
  695. ;
  696.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  697.         Macro
  698.         _GetComponentIconSuite
  699.             moveq               #41,D0
  700.             dc.w                $A82A
  701.         EndM
  702.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  703.         IMPORT_CFM_FUNCTION GetComponentIconSuite
  704.     ENDIF
  705.  
  706.  
  707. ; ********************************************************
  708. ;*                                                        *
  709. ;*              Direct calls to the Components                *
  710. ;*                                                        *
  711. ;*******************************************************
  712.  
  713. ;  Old style names
  714.  
  715. ;
  716. ; pascal long ComponentFunctionImplemented(ComponentInstance ci, short ftnNumber)
  717. ;
  718.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  719.         Macro
  720.         _ComponentFunctionImplemented
  721.             move.l              #$0002FFFD,-(sp)
  722.             moveq               #0,D0
  723.             dc.w                $A82A
  724.         EndM
  725.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION ComponentFunctionImplemented
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal long GetComponentVersion(ComponentInstance ci)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  733.         Macro
  734.         _GetComponentVersion
  735.             move.l              #$0000FFFC,-(sp)
  736.             moveq               #0,D0
  737.             dc.w                $A82A
  738.         EndM
  739.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  740.         IMPORT_CFM_FUNCTION GetComponentVersion
  741.     ENDIF
  742.  
  743. ;
  744. ; pascal long ComponentSetTarget(ComponentInstance ci, ComponentInstance target)
  745. ;
  746.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  747.         Macro
  748.         _ComponentSetTarget
  749.             move.l              #$0004FFFA,-(sp)
  750.             moveq               #0,D0
  751.             dc.w                $A82A
  752.         EndM
  753.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  754.         IMPORT_CFM_FUNCTION ComponentSetTarget
  755.     ENDIF
  756.  
  757. ;  New style names
  758.  
  759. ;
  760. ; pascal ComponentResult CallComponentOpen(ComponentInstance ci, ComponentInstance self)
  761. ;
  762.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  763.         Macro
  764.         _CallComponentOpen
  765.             move.l              #$0004FFFF,-(sp)
  766.             moveq               #0,D0
  767.             dc.w                $A82A
  768.         EndM
  769.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  770.         IMPORT_CFM_FUNCTION CallComponentOpen
  771.     ENDIF
  772.  
  773. ;
  774. ; pascal ComponentResult CallComponentClose(ComponentInstance ci, ComponentInstance self)
  775. ;
  776.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  777.         Macro
  778.         _CallComponentClose
  779.             move.l              #$0004FFFE,-(sp)
  780.             moveq               #0,D0
  781.             dc.w                $A82A
  782.         EndM
  783.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  784.         IMPORT_CFM_FUNCTION CallComponentClose
  785.     ENDIF
  786.  
  787. ;
  788. ; pascal ComponentResult CallComponentCanDo(ComponentInstance ci, short ftnNumber)
  789. ;
  790.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  791.         Macro
  792.         _CallComponentCanDo
  793.             move.l              #$0002FFFD,-(sp)
  794.             moveq               #0,D0
  795.             dc.w                $A82A
  796.         EndM
  797.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  798.         IMPORT_CFM_FUNCTION CallComponentCanDo
  799.     ENDIF
  800.  
  801. ;
  802. ; pascal ComponentResult CallComponentVersion(ComponentInstance ci)
  803. ;
  804.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  805.         Macro
  806.         _CallComponentVersion
  807.             move.l              #$0000FFFC,-(sp)
  808.             moveq               #0,D0
  809.             dc.w                $A82A
  810.         EndM
  811.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  812.         IMPORT_CFM_FUNCTION CallComponentVersion
  813.     ENDIF
  814.  
  815. ;
  816. ; pascal ComponentResult CallComponentRegister(ComponentInstance ci)
  817. ;
  818.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  819.         Macro
  820.         _CallComponentRegister
  821.             move.l              #$0000FFFB,-(sp)
  822.             moveq               #0,D0
  823.             dc.w                $A82A
  824.         EndM
  825.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  826.         IMPORT_CFM_FUNCTION CallComponentRegister
  827.     ENDIF
  828.  
  829. ;
  830. ; pascal ComponentResult CallComponentTarget(ComponentInstance ci, ComponentInstance target)
  831. ;
  832.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  833.         Macro
  834.         _CallComponentTarget
  835.             move.l              #$0004FFFA,-(sp)
  836.             moveq               #0,D0
  837.             dc.w                $A82A
  838.         EndM
  839.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  840.         IMPORT_CFM_FUNCTION CallComponentTarget
  841.     ENDIF
  842.  
  843. ;
  844. ; pascal ComponentResult CallComponentUnregister(ComponentInstance ci)
  845. ;
  846.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  847.         Macro
  848.         _CallComponentUnregister
  849.             move.l              #$0000FFF9,-(sp)
  850.             moveq               #0,D0
  851.             dc.w                $A82A
  852.         EndM
  853.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  854.         IMPORT_CFM_FUNCTION CallComponentUnregister
  855.     ENDIF
  856.  
  857. ;
  858. ; pascal ComponentResult CallComponentGetMPWorkFunction(ComponentInstance ci, ComponentMPWorkFunctionUPP *workFunction, void **refCon)
  859. ;
  860.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  861.         Macro
  862.         _CallComponentGetMPWorkFunction
  863.             move.l              #$0008FFF8,-(sp)
  864.             moveq               #0,D0
  865.             dc.w                $A82A
  866.         EndM
  867.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  868.         IMPORT_CFM_FUNCTION CallComponentGetMPWorkFunction
  869.     ENDIF
  870.  
  871.  
  872.     IF ¬ TARGET_OS_MAC THEN
  873. ;  
  874. ;        CallComponent is used by ComponentGlue routines to manually call a component function.
  875. ;     
  876.  
  877. ;
  878. ; pascal ComponentResult CallComponent(ComponentInstance ci, ComponentParameters *cp)
  879. ;
  880.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  881.         IMPORT_CFM_FUNCTION CallComponent
  882.     ENDIF
  883.  
  884.     ENDIF
  885. ;  UPP call backs 
  886. ;  ProcInfos 
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.     ENDIF ; __COMPONENTS__ 
  894.  
  895.